package com.upnp.action;

import android.content.Context;
import android.util.Log;

public class UPnpProcess{
	
	static {
        System.loadLibrary("org_jni_UPnpProcess");
	}
	
	private static UPnpProcess  m_process;
	
	private JniInterface        m_jni;
	private Context 	    	m_con;
	
	public native String upnpSrvStart(String path, String filename, String accountpath, JniInterface obj);
	public native int upnpSrvConnect(String uuid, String accountpath);
	public native void upnpSrvRunning(JniInterface obj, String aName, String idList);
	public native int upnpSrvStop(String uuid);
	public native int setnotify(String message,int notify);
	
	private UPnpProcess(Context con){
		this.m_con = con;
		this.m_jni = new JniInterface(m_con);
		Log.i(this.getClass().getName(), "INIT FINISH !");
	}
	
	public JniInterface getEObj(){
		return this.m_jni;
	}
	public static UPnpProcess createInstance(Context con){
		if(m_process == null){
			m_process = new UPnpProcess(con);
		}
		return m_process;
	}
}
